/**
 * 
 */
package info.niwota.webshot;

import java.io.Serializable;

/**
 * @author qiangli
 *
 */
public class FileItem implements Serializable, Comparable<FileItem> {

	private static final long serialVersionUID = 1L;
	
	public String name;
	public long size;
	public long modified;
	public boolean locked;
	
	public FileItem() {
	}

	public FileItem(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public long getModified() {
		return modified;
	}

	public void setModified(long modified) {
		this.modified = modified;
	}

	@Override
	public String toString() {
		return name;
	}

	public int compareTo(FileItem other) {
		if (other == null) {
			return -1;
		}
		if (other.name == null) {
			return -1;
		}
		//
		if (this.name == null) {
			return 1;
		}
		return this.name.compareTo(other.name);
	}
}
